package Demo4;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 34255
 * Date: 2024-05-21
 * Time: 20:07
 */
public class Test {
    public int a = 1;
    private int b = 2;
    private static final int c = 3;

//    static class A{//静态内部类
    class A{//实力内部类
        public int a = 4;
        private int e = 5;
        static int f = 6;

        void test2(){
            System.out.println("test2()...");
            System.out.println(Test.this.a);
            System.out.println(this.a);
            System.out.println(a);
            System.out.println(b);
            System.out.println(c);
//            System.out.println(d);
            System.out.println(e);
            System.out.println(f);
        }
    }

    void test1(){
        System.out.println("test1()...");
    }

    public static void main(String[] args) {
//        如何通过静态内部类类型来实例化一个静态内部类
//        如何通过实例内部类类型来实例化一个实例内部类
        Test t = new Test();
        Test.A a = t.new A();
        a.test2();
    }
}
